import { NextRequest } from 'next/server';

/**
 * 从cookie里取userId
 * @param req
 * @returns
 */
export default function getUserId(req: NextRequest): string | null {
  const userId = req.cookies.get('userId')?.value;
  return userId || null;
}